package cn.jnetty.ioc.method;

import cn.jnetty.api.executors.JExecutors;
import cn.jnetty.api.handler.*;
import cn.jnetty.api.interceptor.HandlerInterceptor;

/**
 * @author 猪哥亮
 * @email 1030681978@qq.com
 * @date 2020/4/14 10:31
 * 描述：
 */
public abstract class AbstractRouterHandler<T> implements RouterHandler<T> {
    protected RequestDefinitionBean requestDefinitionBean;
    protected ParameterHandler parameterHandler;
    protected HandlerInterceptor interceptor;
    protected JExecutors jExecutors;

    @Override
    public void setJRequestDefinitionBean(RequestDefinitionBean bean) {
        this.requestDefinitionBean = bean;
    }

    @Override
    public void setParameterHandler(ParameterHandler bean) {
        this.parameterHandler = bean;
    }

    @Override
    public void setHandlerInterceptor(HandlerInterceptor bean) {
        this.interceptor = bean;
    }

    @Override
    public RequestDefinitionBean getJRequestDefinitionBean() {
        return requestDefinitionBean;
    }

    @Override
    public HandlerInterceptor getHandlerInterceptor() {
        return interceptor;
    }

    @Override
    public void setJExcutors(JExecutors jExcutors) {
        this.jExecutors = jExcutors;
    }

    @Override
    public JExecutors getJExcutors() {
        return jExecutors;
    }

    @Override
    public BytesParameterHandler getParameterHandler() {
        return (BytesParameterHandler) parameterHandler;
    }

    public HandlerInterceptor getInterceptor() {
        return interceptor;
    }
}
